﻿Ext.define("LibOCApp.view.loginContainer", {
    extend: "Ext.Container",
    alias: "widget.aliasloginContainer",

    initialize: function () {

        this.callParent(arguments);
        
        var btToolbar = {
            xtype: 'toolbar',
            docked: 'top',
            title: 'Lista de Ordenes de Compra',
            items: [
            {
                xtype: 'button',
                text: 'Regresar',
                ui: 'back',
                handler: this.onBackListBtnTap,
                scope: this
            },
            {
                xtype: 'spacer'
            },
            {
                xtype: 'button',
                text: 'Liberar',
                ui: 'action'
            }]
        };
        
        var listaOC = {
            xtype: 'aliaslistaOC',
            store: Ext.getStore("ordenCompra"),
            listeners: {
                disclose: { fn: this.onNotesListDisclose, scope: this }
            }
        }

        this.add([btToolbar, listaOC]);
    },
    onBackListBtnTap: function() {
        console.log("backLoginBtnCmd");
        this.fireEvent("backLoginBtnCmd", this);
    },
    onNotesListDisclose: function (list, record, target, index, evt, options) {
        console.log("editNoteCommand");
        //this.fireEvent('editNoteCommand', this, record);
    },
    config: {
        layout: {
            type: 'fit'
        }
    }
});